home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 098 / cstd.arc / CSTD7#2 < prev    next >
Encoding:
Text File  |  1985-07-28  |  3.0 KB  |  81 lines

  1. /* ---------- "mod.std.c Digest V7#2" ---------- */
  2. From: Orlando Sotomayor-Diaz (The Moderator) <cbosgd!std-c>
  3.  
  4.  
  5. mod.std.c Digest            Tue, 18 Jun 85       Volume 7 : Issue   2 
  6.  
  7. Today's Topics:
  8.                         syntax vs constraints
  9.               Union Initialization - can it have braces?
  10. ----------------------------------------------------------------------
  11.  
  12. Date: 23:48 June 7, 1985
  13. From: sfbc!lr
  14. Subject: syntax vs constraints
  15. To: houxm!homxa!osd7
  16.  
  17. Several readers of the ANSI draft have observed that the syntax
  18. allows constructions with absurd semantics.  These are not bugs.
  19. The syntax must be read together with the "constraints" to see
  20. what the grammar really allows.  Some constraints (such as those
  21. prohibiting type-clashes of various kinds in assignment) are
  22. difficult to express in a phrase-structure grammar; some (such
  23. as those prohibiting type comnbinations such as "unsigned float")
  24. obviate the need to list all permissible type combinations in the
  25. syntax.  The number of productions would be enormous, especially
  26. as the order of storage-class and type specifiers is unspecified.
  27. ("int long unsigned static x = 0;" is perfectly grammatical C,
  28. though rather weird stylistically!)
  29.  
  30. We appreciate the efforts of readers to improve the draft, and
  31. hope they will examine the grammar including constraints as
  32. well as syntax.
  33.  
  34. Larry Rosler, X3J11 redactor.
  35.  
  36. ------------------------------
  37.  
  38. Date: 18 Jun 85 17:46:02 +1000 (Tue)
  39. From: David A. Price <seismo!munnari!mulga.oz!dap>
  40. Subject: Union Initialization - can it have braces?
  41. To: std-c@cbosgd
  42.  
  43.         The C Draft says in  5.6 Initialization  (just before the
  44. Examples)   "When the declared object is a union, the initializer
  45. initializes the  member  that appears first in the declaration of
  46. the union".
  47.         Does a union initializer take a (possible) pair of braces
  48. in its own right?  Is a union an "aggregate" in the Draft's usage
  49. of the term?   I cannot find where the Draft defines its usage of
  50. "scalar" and "aggregate".
  51.         Hence, is         static union { int i; } a[2] = { 0, 1};
  52. a completely-bracketed initialization?
  53.  
  54. David Price                                    seismo!munnari!dap
  55.  
  56. Department of Computer Science,
  57. University of Melbourne,
  58. Parkville, 3052.     AUSTRALIA.
  59.  
  60. [ The author refers to the 11/12/84 draft, I guess.  The 85-045
  61. draft says in section C1.2.5:
  62.  
  63. "Arithmetic types and pointers are collectively called scalar types.
  64. Arrays and structures are collectively called aggregate types."
  65.  
  66. Back in section 5.6:
  67.  
  68. "...the [aggregate] initializer is a brace-enclosed list of initializers
  69. for the members of the aggregate, written in increasing subscript or member
  70. order."
  71.  
  72. Let's not begin again the "union initialization" debate.
  73.  
  74.                         -- Mod --
  75. ]
  76.  
  77. ------------------------------
  78.  
  79. End of mod.std.c Digest - Tue, 18 Jun 85 23:45:11 EDT
  80. ******************************
  81.